﻿using Microsoft.AspNetCore.Http;
using Simple.Repository.Models.ClassRoom;

namespace Simple.Services;

public class ClassDynamicCreateOrUpdateModel : ModelBase
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public Guid? Id { get; set; } = null;

    /// <summary>
    /// 动态内容
    /// </summary>
    [Required(ErrorMessage = "请填写动态内容!")]
    public string? Content { get; set; } = "";

    /// <summary>
    /// 发送班级
    /// </summary>
    [Required(ErrorMessage = "请选择发送班级!")]
    public List<Guid>? ClassIdList { get; set; } = null;

    /// <summary>
    /// 图片
    /// </summary>
    public List<IFormFile>? ImageList { get; set; } = null;

    public override void ConfigureMapper(Profile profile)
    {
        profile.CreateMap<ClassDynamic, ClassDynamicCreateOrUpdateModel>();

        profile.CreateMap<ClassDynamicCreateOrUpdateModel, ClassDynamic>();
    }
}

public class ChangeStatusModel
{
    public Guid? Id { get; set; }

    /// <summary>
    /// 状态 1-已发布,2-已屏蔽
    /// </summary>
    public int? Status { get; set; } = 1;
}

public class MoveClassDynamicCreateOrUpdateModel : ModelBase
{
    /// <summary>
    /// 图片
    /// </summary>
    public List<Guid>? ImageIdList { get; set; } = null;

    /// <summary>
    /// 主键Id
    /// </summary>
    public Guid? Id { get; set; } = null;

    /// <summary>
    /// 动态内容
    /// </summary>
    public string? Content { get; set; } = "";

    /// <summary>
    /// 发送班级
    /// </summary>
    public List<Guid>? ClassIdList { get; set; } = null;

    /// <summary>
    /// 图片
    /// </summary>
    public List<IFormFile>? ImageList { get; set; } = null;

    public override void ConfigureMapper(Profile profile)
    {
        profile.CreateMap<ClassDynamic, ClassDynamicCreateOrUpdateModel>();

        profile.CreateMap<ClassDynamicCreateOrUpdateModel, ClassDynamic>();
    }
}

public class ClassDynamicCreateOrUpdateCommandModel : ModelBase
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public Guid? Id { get; set; } = null;

    /// <summary>
    /// 动态内容
    /// </summary>
    public string? Content { get; set; } = "";

    /// <summary>
    /// 发送班级
    /// </summary>
    public List<Guid>? ClassIdList { get; set; } = null;

    public override void ConfigureMapper(Profile profile)
    {
        profile.CreateMap<ClassDynamic, ClassDynamicCreateOrUpdateCommandModel>();

        profile.CreateMap<ClassDynamicCreateOrUpdateCommandModel, ClassDynamic>();
    }
}
